package com.example.entity;

import java.util.Objects;

import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

/**
 * Copyright: Copyright (c) 2022
 *
 * <p>
 * Description: db块文件
 *
 * @author LiuFeng
 * @version 2022/11/11 9:19
 * @since
 */
@Getter
@Setter
@Data
public class DbBlock {

    @ExcelProperty(index = 0)
    private String name;

    @ExcelProperty(index = 1)
    private String comment;

    @ExcelProperty(index = 2)
    private String type;

    @ExcelProperty(index = 3)
    private Integer length;

    @ExcelProperty(index = 4)
    private String format;

    @ExcelProperty(index = 5)
    private String connection;

    @ExcelProperty(index = 6)
    private String cGroup;

    @ExcelProperty(index = 7)
    private String addrParams;

    @ExcelProperty(index = 8)
    private String scaleValid;

    @ExcelProperty(index = 9)
    private String scaleParam1;

    @ExcelProperty(index = 10)
    private String scaleParam2;

    @ExcelProperty(index = 11)
    private String scaleParam3;

    @ExcelProperty(index = 12)
    private String scaleParam4;

    @ExcelProperty(index = 13)
    private String minLimit;

    @ExcelProperty(index = 14)
    private String maxLimit;

    @ExcelProperty(index = 15)
    private String startValue;


    @ExcelProperty(index = 16)
    private String substValue;

    @ExcelProperty(index = 17)
    private String substValueOnMinLimit;

    @ExcelProperty(index = 18)
    private String substValueOnMaxLimit;

    @ExcelProperty(index = 19)
    private String substValueAsStartValue;

    @ExcelProperty(index = 20)
    private String substValueOnError;

    @ExcelProperty(index = 21)
    private String updateMode;

    @ExcelProperty(index = 22)
    private String synchronization;

    @ExcelProperty(index = 23)
    private String runtimePersistence;

    @ExcelProperty(index = 24)
    private String plcVariableName;

    @ExcelProperty(index = 25)
    private String plcBlockName;

    @ExcelProperty(index = 26)
    private String writeProtect;

    @ExcelProperty(index = 27)
    private String readProtect;

    @ExcelProperty(index = 28)
    private String gmpRelevant;

    @ExcelProperty(index = 29)
    private String cloudEnabled;

    @ExcelProperty(index = 30)
    private String cloudCycle;


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DbBlock block = (DbBlock) o;
        return Objects.equals(name, block.name) && Objects.equals(comment, block.comment) && Objects.equals(type, block.type) && Objects.equals(length, block.length) && Objects.equals(format, block.format) && Objects.equals(cGroup, block.cGroup) && Objects.equals(addrParams, block.addrParams);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, comment, type, length, format, cGroup, addrParams);
    }
}
